/**
 * Created by hxpeng on 2017/4/28.
 */
(function () {
    'use strict';

    angular.module('App.pages.member.entrust', [])
        .config(routeConfig);

    function routeConfig($stateProvider) {
        $stateProvider.state('entrust', {
            url: "/entrust",
            abstract: true,
            templateUrl: 'source/pages/page-tab.html',
        }).state('entrust.create', {
            url: "/create/{entrustId:string}",
            cache: false,
            params: {
                entrustId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/entrust/entrust-create.html',
                    controller:'NewEntrustCtrl as vm',
                    resolve: {
                        entrustId: function($stateParams){
                            return $stateParams.entrustId;
                        }
                    }
                }
            }
        }).state('entrust.entrustInfo', {
            url: "/entrustInfo/{entrustId:string}",
            cache: false,
            params: {
                entrustId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/entrust/entrust-info.html',
                    controller:'EntrustInfoCtrl as vm',
                    resolve: {
                        entrustId: function($stateParams){
                            return $stateParams.entrustId;
                        }
                    }
                }
            }
        }).state('entrust.parentEntrustList', {
            url: "/parentEntrustList",
            cache: true,
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/entrust/parent-entrust-list.html',
                    controller:'ParentEntrustCtrl as vm'
                }
            }
        }).state('entrust.teacherEntrustList', {
            url: "/teacherEntrustList",
            cache: true,
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/member/entrust/teacher-entrust-list.html',
                    controller:'TeacherEntrustCtrl as vm'
                }
            }
        });
    }
})();